home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / MUIRexxDock / dock_change.rexx < prev    next >
OS/2 REXX Batch file  |  1997-06-09  |  3KB  |  125 lines

  1. /* */
  2. options results
  3. parse arg m' 'n1' 'obj1' 'n2' 'obj2
  4.  
  5. address dock
  6.  
  7. MUIA_Disabled = 0x80423661
  8. MUIA_Draggable = 0x80420b6e
  9. MUIA_Dropable = 0x8042fbce
  10. MUIA_Frame = 0x8042ac64
  11. MUIA_InputMode = 0x8042fb04
  12.  
  13. MUIV_Frame_None = 0
  14. MUIV_InputMode_RelVerify = 1
  15. MUIV_List_Insert_Bottom = -3
  16. TRUE = 1
  17. FALSE = 0
  18.  
  19. attrs1 = MUIA_Frame MUIV_Frame_None MUIA_Draggable TRUE
  20. attrs2 = MUIA_Frame MUIV_Frame_None MUIA_Draggable TRUE
  21.  
  22. if n2 ~= 0 then do
  23.     if n1 ~= 0 then do
  24.         getvar B||m||n1
  25.         entry1 = result
  26.  
  27.         getvar B||m||n2
  28.         entry2 = result
  29.  
  30.         setvar B||m||n1 entry2
  31.         setvar B||m||n2 entry1
  32.  
  33.         call dock_object m n2
  34.         call dock_mode m n2 0
  35.         callhook ID m||n2 DROP COMMAND """dock_change "m" "n2" "obj1" %s"""
  36.         call dock_object m n1
  37.         call dock_mode m n1 0
  38.         call dock_save m
  39.     end
  40.     else do
  41.         type = 'button'
  42.         object2 = type
  43.         opt2 = ''
  44.         getvar B||m||n2
  45.         entry2 = result
  46.  
  47.         if entry2 ~= '' then do
  48.             parse var entry2 type' 'opt2
  49.             parse var opt2 'ICON "'obj'"'
  50.             if lastpos('/',obj) ~= 0 then objname = substr(obj,lastpos('/',obj)+1)
  51.             else objname = substr(obj,lastpos(':',obj)+1)
  52.         end
  53.         else exit
  54.         cycle ID BTYPE LABEL type
  55.         list ID LLST STRING
  56.         if type = 'pop' then do
  57.             call open('pop',objname'.pop','R')
  58.             do while ~eof('pop')
  59.                 line = readln('pop')
  60.                 if line ~= '' then
  61.                     list ID LLST POS MUIV_List_Insert_Bottom INSERT STRING '='line
  62.             end
  63.             call close('pop')
  64.         end
  65.  
  66.         parse var opt2 'PCOMM "'bcomm'"'
  67.         parse var opt2 'PPORT "'bport'"'
  68.         popasl ID PCOMM CONTENT bcomm
  69.         string ID PPORT CONTENT bport
  70.  
  71.         parse var opt2 'ACOMM "'bcomm'"'
  72.         parse var opt2 'APORT "'bport'"'
  73.         popasl ID ACOMM CONTENT bcomm
  74.         string ID APORT CONTENT bport
  75.  
  76.         parse var opt2 'DCOMM "'bcomm'"'
  77.         parse var opt2 'DPORT "'bport'"'
  78.         popasl ID DCOMM CONTENT bcomm
  79.         string ID DPORT CONTENT bport
  80.  
  81.         list ID ILST STRING
  82.         if exists(objname'.add') then do
  83.             call open('add',objname'.add','R')
  84.             do while ~eof('add')
  85.                 line = readln('add')
  86.                 if line ~= '' then
  87.                     list ID ILST POS MUIV_List_Insert_Bottom INSERT STRING '='line
  88.             end
  89.             call close('add')
  90.         end
  91.  
  92.         setvar B00 entry2
  93.         call dock_object 0 0
  94.         group ID 'G00' ATTRS MUIA_Dropable FALSE
  95.         button ID '00' ATTRS MUIA_Draggable TRUE
  96.         setvar ITEM n2
  97.     end
  98. end
  99. else do
  100.     if n1 ~= 0 then do
  101.         call dock_set m n1 obj2
  102.         call dock_object m n1
  103.         call dock_mode m n1 0
  104.         call dock_save m
  105.     end
  106.     else do
  107.         setvar B00 'button ICON "'||obj2||'"'
  108.         cycle ID BTYPE LABEL 'button'
  109.         popasl ID PCOMM CONTENT ""
  110.         string ID PPORT CONTENT ""
  111.         popasl ID ACOMM CONTENT ""
  112.         string ID APORT CONTENT ""
  113.         popasl ID DCOMM CONTENT ""
  114.         string ID DPORT CONTENT ""
  115.         list ID LLST STRING
  116.         list ID ILST STRING
  117.  
  118.         group ID 'G00'
  119.          button ID '00' ICON obj2 ATTRS MUIA_Frame MUIV_Frame_None MUIA_Draggable TRUE LABEL 0 obj2
  120.         endgroup
  121.         group ID 'G00' ATTRS MUIA_Dropable FALSE
  122.         call dock_object 0 0
  123.     end
  124. end
  125.